* Wealth index calculation. Trevor Croft, 07/29/2015. Bangladesh DHS 2014. cd 'C:\Projects\Analysis\Wealth Index Construction\BD71'. include file='C:\Projects\Analysis\Wealth Index Construction\BD71\wealth_assets.sps'. missing values QH122C (99.99). execute. * Macro definitions to perform some recoding automatically. * Note: Do not use an asterisk in front of a macro name to try to comment it out - it will run any way because of the way the macros are expanded. * Delete the line instead or change the spelling of the macro in the comment. * Do not use the names of macros in comments - they will also be expanded too, and likely will fail. *{Create binary variables based on condition and give label }. define dichotomize( !positional !enclose('(',')') / !positional !tokens(1) / !positional !tokens(1) ) compute !2=0. if (!1) !2=1. variable labels !2 !3. value labels !2 0 'No' 1 'Yes'. formats !2 (f1.0). !enddefine. *(Separate shared toilets from non-shared toilets). define shared_fac( !positional !tokens(1) / !positional !tokens(1) / !positional !tokens(1) ). compute !2 = 0. do if (QH108=1). + if (!1=1) !2 = 1. + compute !1 = 0. end if. variable labels !2 !3. value labels !2 0 'No' 1 'Yes'. formats !2 (f1.0). !enddefine. *{Reset missing values to 'does not have', change 2 code to 0}. define no2zero( !positional !tokens(1) ) if (missing(!1) | !1<>1) !1=0. value labels !1 0 'No' 1 'Yes'. !enddefine. *{Construct Variables}. * Source of drinking water. dichotomize (QH102=11) QH102_11 "Source of drinking water: Piped - into dwelling". dichotomize (QH102=12) QH102_12 "Source of drinking water: Piped - into yard/plot". dichotomize (QH102=13) QH102_13 "Source of drinking water: Piped - public tap / standpipe". dichotomize (QH102=21) QH102_21 "Source of drinking water: Tube well or borehole". dichotomize (QH102=31) QH102_31 "Source of drinking water: Dug well - protected". dichotomize (QH102=32) QH102_32 "Source of drinking water: Dug well - unprotected". dichotomize (QH102=41) QH102_41 "Source of drinking water: Spring - protected". dichotomize (QH102=42) QH102_42 "Source of drinking water: Spring - unprotected". dichotomize (QH102=51) QH102_51 "Source of drinking water: Rainwater". dichotomize (QH102=61) QH102_61 "Source of drinking water: Tanker truck". dichotomize (QH102=71) QH102_71 "Source of drinking water: Cart with small tank". dichotomize (QH102=81) QH102_81 "Source of drinking water: Surface water (river/dam/lake/pond/stream/canal/irrigation channel". dichotomize (QH102=91) QH102_91 "Source of drinking water: Bottled water". dichotomize (QH102=96) QH102_96 "Source of drinking water: Other". * Type of toilet facility. dichotomize (QH107=10) QH107_10 "Type of toilet facility: FLUSH TOILET". dichotomize (QH107=11) QH107_11 "Type of toilet facility: Flush - to piped sewer system". dichotomize (QH107=12) QH107_12 "Type of toilet facility: Flush - to septic tank". dichotomize (QH107=13) QH107_13 "Type of toilet facility: Flush - to pit latrine". dichotomize (QH107=14) QH107_14 "Type of toilet facility: Flush - to somewhere else". dichotomize (QH107=15) QH107_15 "Type of toilet facility: Flush - don't know where". dichotomize (QH107=20) QH107_20 "Type of toilet facility: PIT TOILET LATRINE". dichotomize (QH107=21) QH107_21 "Type of toilet facility: Pit latrine - ventilated improved pit (VIP)". dichotomize (QH107=22) QH107_22 "Type of toilet facility: Pit latrine - with slab". dichotomize (QH107=23) QH107_23 "Type of toilet facility: Pit latrine - without slab / open pit". dichotomize (QH107=30) QH107_30 "Type of toilet facility: NO FACILITY". dichotomize (QH107=31) QH107_31 "Type of toilet facility: Composting toilet". dichotomize (QH107=41) QH107_41 "Type of toilet facility: Bucket toilet". dichotomize (QH107=51) QH107_51 "Type of toilet facility: Hanging toilet / hanging latrine". dichotomize (QH107=61) QH107_61 "Type of toilet facility: No facility/bush/field". dichotomize (QH107=96) QH107_96 "Type of toilet facility: Other". shared_fac QH107_10 QH107_10_sh "Type of toilet facility: FLUSH TOILET - shared". shared_fac QH107_11 QH107_11_sh "Type of toilet facility: Flush - to piped sewer system - shared". shared_fac QH107_12 QH107_12_sh "Type of toilet facility: Flush - to septic tank - shared". shared_fac QH107_13 QH107_13_sh "Type of toilet facility: Flush - to pit latrine - shared". shared_fac QH107_14 QH107_14_sh "Type of toilet facility: Flush - to somewhere else - shared". shared_fac QH107_15 QH107_15_sh "Type of toilet facility: Flush - don't know where - shared". shared_fac QH107_20 QH107_20_sh "Type of toilet facility: PIT TOILET LATRINE - shared". shared_fac QH107_21 QH107_21_sh "Type of toilet facility: Pit latrine - ventilated improved pit (VIP) - shared". shared_fac QH107_22 QH107_22_sh "Type of toilet facility: Pit latrine - with slab - shared". shared_fac QH107_23 QH107_23_sh "Type of toilet facility: Pit latrine - without slab / open pit - shared". shared_fac QH107_30 QH107_30_sh "Type of toilet facility: NO FACILITY - shared". shared_fac QH107_31 QH107_31_sh "Type of toilet facility: Composting toilet - shared". shared_fac QH107_41 QH107_41_sh "Type of toilet facility: Bucket toilet - shared". shared_fac QH107_51 QH107_51_sh "Type of toilet facility: Hanging toilet / hanging latrine - shared". shared_fac QH107_96 QH107_96_sh "Type of toilet facility: Other - shared". * Electricity. no2zero QH110A. * Solar Electricity. no2zero QH110B. * Radio. no2zero QH110C. * Television. no2zero QH110D. * Mobile telephone. no2zero QH110E. * Telephone (non-mobile). no2zero QH110F. * Refrigerator. no2zero QH110G. * Almirah/wardrobe. no2zero QH110H. * Electric Fan. no2zero QH110I. * DVD/VCD Player. no2zero QH110J. * Water Pump. no2zero QH110K. * IPS/Generator. no2zero QH110L. * Air Conditioner. no2zero QH110M. * Computer/Laptop. no2zero QH110N. * Type of cooking fuel. dichotomize (QH111=1) QH111_1 "Type of cooking fuel: Electricity". dichotomize (QH111=2) QH111_2 "Type of cooking fuel: LPG". dichotomize (QH111=3) QH111_3 "Type of cooking fuel: Natural gas". dichotomize (QH111=4) QH111_4 "Type of cooking fuel: Biogas". dichotomize (QH111=5) QH111_5 "Type of cooking fuel: Kerosene". dichotomize (QH111=6) QH111_6 "Type of cooking fuel: Coal, lignite". dichotomize (QH111=7) QH111_7 "Type of cooking fuel: Charcoal". dichotomize (QH111=8) QH111_8 "Type of cooking fuel: Wood". dichotomize (QH111=9) QH111_9 "Type of cooking fuel: Straw / shrubs / grass". dichotomize (QH111=10) QH111_10 "Type of cooking fuel: Agricultural crop". dichotomize (QH111=11) QH111_11 "Type of cooking fuel: Animal dung". dichotomize (QH111=95) QH111_95 "Type of cooking fuel: No food cooked in HH". dichotomize (QH111=96) QH111_96 "Type of cooking fuel: Other". * Household has separate room used as kitchen. no2zero QH113. * Main material of floor. dichotomize (QH114=11) QH114_11 "Main material of floor: Earth, sand". dichotomize (QH114=21) QH114_21 "Main material of floor: Wood planks". dichotomize (QH114=22) QH114_22 "Main material of floor: Palm, bamboo". dichotomize (QH114=31) QH114_31 "Main material of floor: Parquet, polished wood". dichotomize (QH114=33) QH114_33 "Main material of floor: Ceramic tiles". dichotomize (QH114=34) QH114_34 "Main material of floor: Cement". dichotomize (QH114=35) QH114_35 "Main material of floor: Carpet". dichotomize (QH114=96) QH114_96 "Main material of floor: Other". * Main roof material. dichotomize (QH115=11) QH115_11 "Main roof material: No roof". dichotomize (QH115=12) QH115_12 "Main roof material: Thatch / palm leaf". dichotomize (QH115=22) QH115_22 "Main roof material: Palm / bamboo". dichotomize (QH115=23) QH115_23 "Main roof material: Wood planks". dichotomize (QH115=24) QH115_24 "Main roof material: Cardboard". dichotomize (QH115=31) QH115_31 "Main roof material: Tin". dichotomize (QH115=32) QH115_32 "Main roof material: Wood". dichotomize (QH115=34) QH115_34 "Main roof material: Ceramic tiles". dichotomize (QH115=35) QH115_35 "Main roof material: Cement". dichotomize (QH115=36) QH115_36 "Main roof material: Roofing shingles". dichotomize (QH115=96) QH115_96 "Main roof material: Other". * Main wall material. dichotomize (QH116=11) QH116_11 "Main wall material: No walls". dichotomize (QH116=12) QH116_12 "Main wall material: Cane / palm / trunks". dichotomize (QH116=13) QH116_13 "Main wall material: Dirt". dichotomize (QH116=21) QH116_21 "Main wall material: Bamboo with mud". dichotomize (QH116=22) QH116_22 "Main wall material: Stone with mud". dichotomize (QH116=24) QH116_24 "Main wall material: Plywood". dichotomize (QH116=25) QH116_25 "Main wall material: Cardboard". dichotomize (QH116=31) QH116_31 "Main wall material: Tin". dichotomize (QH116=32) QH116_32 "Main wall material: Cement". dichotomize (QH116=33) QH116_33 "Main wall material: Stone with lime / cement". dichotomize (QH116=34) QH116_34 "Main wall material: Bricks". dichotomize (QH116=36) QH116_36 "Main wall material: Wood planks / shingles". dichotomize (QH116=96) QH116_96 "Main wall material: Other". * Car/truck/microbus. no2zero QH118A. * Autobike/tempo/CNG. no2zero QH118B. * Rickshaw/van. no2zero QH118C. * Bicycle. no2zero QH118D. * Motorcycle/scooter. no2zero QH118E. * Bulls/Buffaloes. if (missing(QH122_1) | QH121 <> 1) QH122_1=0. missing values QH122_1 (98,99). compute QH122_1_0 = (QH122_1 = 0). compute QH122_1_1 = (QH122_1 >= 1 & QH122_1 <= 4). compute QH122_1_2 = (QH122_1 >= 5 & QH122_1 <= 9). compute QH122_1_3 = (QH122_1 >= 10 & QH122_1 <= 97). variable labels QH122_1_0 'Bulls/Buffaloes: None' /QH122_1_1 'Bulls/Buffaloes: 1-4' /QH122_1_2 'Bulls/Buffaloes: 5-9' /QH122_1_3 'Bulls/Buffaloes: 10+'. * Milk cows/Bulls. if (missing(QH122_2) | QH121 <> 1) QH122_2=0. missing values QH122_2 (98,99). compute QH122_2_0 = (QH122_2 = 0). compute QH122_2_1 = (QH122_2 >= 1 & QH122_2 <= 4). compute QH122_2_2 = (QH122_2 >= 5 & QH122_2 <= 9). compute QH122_2_3 = (QH122_2 >= 10 & QH122_2 <= 97). variable labels QH122_2_0 'Milk cows/Bulls: None' /QH122_2_1 'Milk cows/Bulls: 1-4' /QH122_2_2 'Milk cows/Bulls: 5-9' /QH122_2_3 'Milk cows/Bulls: 10+'. * Goat/Sheep. if (missing(QH122_3) | QH121 <> 1) QH122_3=0. missing values QH122_3 (98,99). compute QH122_3_0 = (QH122_3 = 0). compute QH122_3_1 = (QH122_3 >= 1 & QH122_3 <= 4). compute QH122_3_2 = (QH122_3 >= 5 & QH122_3 <= 9). compute QH122_3_3 = (QH122_3 >= 10 & QH122_3 <= 97). variable labels QH122_3_0 'Goat/Sheep: None' /QH122_3_1 'Goat/Sheep: 1-4' /QH122_3_2 'Goat/Sheep: 5-9' /QH122_3_3 'Goat/Sheep: 10+'. * Chickens/Ducks. if (missing(QH122_4) | QH121 <> 1) QH122_4=0. missing values QH122_4 (98,99). compute QH122_4_0 = (QH122_4 = 0). compute QH122_4_1 = (QH122_4 >= 1 & QH122_4 <= 4). compute QH122_4_2 = (QH122_4 >= 5 & QH122_4 <= 9). compute QH122_4_3 = (QH122_4 >= 10 & QH122_4 <= 97). variable labels QH122_4_0 'Chickens/Ducks: None' /QH122_4_1 'Chickens/Ducks: 1-4' /QH122_4_2 'Chickens/Ducks: 5-9' /QH122_4_3 'Chickens/Ducks: 10+'. * Other Farm Animals. if (missing(QH122_5) | QH121 <> 1) QH122_5=0. missing values QH122_5 (98,99). compute QH122_5_0 = (QH122_5 = 0). compute QH122_5_1 = (QH122_5 >= 1 & QH122_5 <= 4). compute QH122_5_2 = (QH122_5 >= 5 & QH122_5 <= 9). compute QH122_5_3 = (QH122_5 >= 10 & QH122_5 <= 97). variable labels QH122_5_0 'Other Farm Animals: None' /QH122_5_1 'Other Farm Animals: 1-4' /QH122_5_2 'Other Farm Animals: 5-9' /QH122_5_3 'Other Farm Animals: 10+'. * Household own any homestead. no2zero QH122A. * Amount of land. compute landarea = QH122C. if (missing(QH122C) | QH122C >= 99.98) landarea = 0. if (missing(QH122B) | QH122B <> 1) landarea=0. * Bank account. no2zero QH123. *{Members per sleeping room}. if (hhusual=0) hhusual=hhslept. if (QH117>0) memsleep=trunc(hhusual/QH117). if (QH117=0) memsleep=hhusual. if (memsleep>=98) memsleep=98. variable labels memsleep 'Number of members per sleeping room'. value labels memsleep 0 'Less than 1 per room'. formats memsleep (f2.0). missing values memsleep (98,99). * Compute urban and rural variables coded (1/0) for filters later. compute urban=(QHTYPE = 1). compute rural=(QHTYPE = 2). variable labels urban 'Urban' / rural 'Rural'. value labels urban 1 'Urban' / rural 1 'Rural'. formats urban rural (f1.0). execute. * Check on indicator variable creation. frequencies variables=QHTYPE to domestic. * Toilet facility by shared/not shared. crosstabs /tables=QH107 by QH108. frequencies variables= QH102_11 QH102_12 QH102_13 QH102_21 QH102_31 QH102_32 QH102_41 QH102_42 QH102_51 QH102_61 QH102_71 QH102_81 QH102_91 QH102_96 QH107_10 QH107_11 QH107_12 QH107_13 QH107_14 QH107_15 QH107_20 QH107_21 QH107_22 QH107_23 QH107_30 QH107_31 QH107_41 QH107_51 QH107_61 QH107_96 QH107_10_sh QH107_11_sh QH107_12_sh QH107_13_sh QH107_14_sh QH107_15_sh QH107_20_sh QH107_21_sh QH107_22_sh QH107_23_sh QH107_30_sh QH107_31_sh QH107_41_sh QH107_51_sh QH107_96_sh QH110A QH110B QH110C QH110D QH110E QH110F QH110G QH110H QH110I QH110J QH110K QH110L QH110M QH110N QH111_1 QH111_2 QH111_3 QH111_4 QH111_5 QH111_6 QH111_7 QH111_8 QH111_9 QH111_10 QH111_11 QH111_95 QH111_96 QH113 QH114_11 QH114_21 QH114_22 QH114_31 QH114_33 QH114_34 QH114_35 QH114_96 QH115_11 QH115_12 QH115_22 QH115_23 QH115_24 QH115_31 QH115_32 QH115_34 QH115_35 QH115_36 QH115_96 QH116_11 QH116_12 QH116_13 QH116_21 QH116_22 QH116_24 QH116_25 QH116_31 QH116_32 QH116_33 QH116_34 QH116_36 QH116_96 QH118A QH118B QH118C QH118D QH118E QH122_1_0 QH122_1_1 QH122_1_2 QH122_1_3 QH122_2_0 QH122_2_1 QH122_2_2 QH122_2_3 QH122_3_0 QH122_3_1 QH122_3_2 QH122_3_3 QH122_4_0 QH122_4_1 QH122_4_2 QH122_4_3 QH122_5_0 QH122_5_1 QH122_5_2 QH122_5_3 QH122A landarea QH123 DOMESTIC HOUSE LAND memsleep . * Turn off weights before all factor analysis. weight off. * Name the dataset window for the hh data for use later. dataset name assets. save outfile='assets.sav'. *** Test Factor Analysis. filter off. execute. factor /variables QH102_11 QH102_12 QH102_13 QH102_21 QH102_31 QH102_32 QH102_41 QH102_42 QH102_51 QH102_61 QH102_71 QH102_81 QH102_91 QH102_96 QH107_10 QH107_11 QH107_12 QH107_13 QH107_14 QH107_15 QH107_20 QH107_21 QH107_22 QH107_23 QH107_30 QH107_31 QH107_41 QH107_51 QH107_61 QH107_96 QH107_10_sh QH107_11_sh QH107_12_sh QH107_13_sh QH107_14_sh QH107_15_sh QH107_20_sh QH107_21_sh QH107_22_sh QH107_23_sh QH107_30_sh QH107_31_sh QH107_41_sh QH107_51_sh QH107_96_sh QH110A QH110B QH110C QH110D QH110E QH110F QH110G QH110H QH110I QH110J QH110K QH110L QH110M QH110N QH111_1 QH111_2 QH111_3 QH111_4 QH111_5 QH111_6 QH111_7 QH111_8 QH111_9 QH111_10 QH111_11 QH111_95 QH111_96 QH113 QH114_11 QH114_21 QH114_22 QH114_31 QH114_33 QH114_34 QH114_35 QH114_96 QH115_11 QH115_12 QH115_22 QH115_23 QH115_24 QH115_31 QH115_32 QH115_34 QH115_35 QH115_36 QH115_96 QH116_11 QH116_12 QH116_13 QH116_21 QH116_22 QH116_24 QH116_25 QH116_31 QH116_32 QH116_33 QH116_34 QH116_36 QH116_96 QH118A QH118B QH118C QH118D QH118E QH122_1_0 QH122_1_1 QH122_1_2 QH122_1_3 QH122_2_0 QH122_2_1 QH122_2_2 QH122_2_3 QH122_3_0 QH122_3_1 QH122_3_2 QH122_3_3 QH122_4_0 QH122_4_1 QH122_4_2 QH122_4_3 QH122_5_0 QH122_5_1 QH122_5_2 QH122_5_3 QH122A landarea QH123 DOMESTIC HOUSE LAND memsleep /missing meansub /analysis QH102_11 QH102_12 QH102_13 QH102_21 QH102_31 QH102_32 QH102_41 QH102_42 QH102_51 QH102_61 QH102_71 QH102_81 QH102_91 QH102_96 QH107_10 QH107_11 QH107_12 QH107_13 QH107_14 QH107_15 QH107_20 QH107_21 QH107_22 QH107_23 QH107_30 QH107_31 QH107_41 QH107_51 QH107_61 QH107_96 QH107_10_sh QH107_11_sh QH107_12_sh QH107_13_sh QH107_14_sh QH107_15_sh QH107_20_sh QH107_21_sh QH107_22_sh QH107_23_sh QH107_30_sh QH107_31_sh QH107_41_sh QH107_51_sh QH107_96_sh QH110A QH110B QH110C QH110D QH110E QH110F QH110G QH110H QH110I QH110J QH110K QH110L QH110M QH110N QH111_1 QH111_2 QH111_3 QH111_4 QH111_5 QH111_6 QH111_7 QH111_8 QH111_9 QH111_10 QH111_11 QH111_95 QH111_96 QH113 QH114_11 QH114_21 QH114_22 QH114_31 QH114_33 QH114_34 QH114_35 QH114_96 QH115_11 QH115_12 QH115_22 QH115_23 QH115_24 QH115_31 QH115_32 QH115_34 QH115_35 QH115_36 QH115_96 QH116_11 QH116_12 QH116_13 QH116_21 QH116_22 QH116_24 QH116_25 QH116_31 QH116_32 QH116_33 QH116_34 QH116_36 QH116_96 QH118A QH118B QH118C QH118D QH118E QH122_1_0 QH122_1_1 QH122_1_2 QH122_1_3 QH122_2_0 QH122_2_1 QH122_2_2 QH122_2_3 QH122_3_0 QH122_3_1 QH122_3_2 QH122_3_3 QH122_4_0 QH122_4_1 QH122_4_2 QH122_4_3 QH122_5_0 QH122_5_1 QH122_5_2 QH122_5_3 QH122A landarea QH123 DOMESTIC HOUSE LAND memsleep /print univariate initial extraction /criteria factors(1) iterate(25) /extraction pc /rotation norotate /method=correlation. **** Redo removing area-specific variables ****. ** Agricultural animal variables excluded? ** Land area excluded? ** Any others ?. *** Common Factor Analysis. filter off. execute. factor /variables QH102_11 QH102_12 QH102_13 QH102_21 QH102_31 QH102_32 QH102_41 QH102_42 QH102_51 QH102_61 QH102_71 QH102_81 QH102_91 QH102_96 QH107_10 QH107_11 QH107_12 QH107_13 QH107_14 QH107_15 QH107_20 QH107_21 QH107_22 QH107_23 QH107_30 QH107_31 QH107_41 QH107_51 QH107_61 QH107_96 QH107_10_sh QH107_11_sh QH107_12_sh QH107_13_sh QH107_14_sh QH107_15_sh QH107_20_sh QH107_21_sh QH107_22_sh QH107_23_sh QH107_30_sh QH107_31_sh QH107_41_sh QH107_51_sh QH107_96_sh QH110A QH110B QH110C QH110D QH110E QH110F QH110G QH110H QH110I QH110J QH110K QH110L QH110M QH110N QH111_1 QH111_2 QH111_3 QH111_4 QH111_5 QH111_6 QH111_7 QH111_8 QH111_9 QH111_10 QH111_11 QH111_95 QH111_96 QH113 QH114_11 QH114_21 QH114_22 QH114_31 QH114_33 QH114_34 QH114_35 QH114_96 QH115_11 QH115_12 QH115_22 QH115_23 QH115_24 QH115_31 QH115_32 QH115_34 QH115_35 QH115_36 QH115_96 QH116_11 QH116_12 QH116_13 QH116_21 QH116_22 QH116_24 QH116_25 QH116_31 QH116_32 QH116_33 QH116_34 QH116_36 QH116_96 QH118A QH118B QH118C QH118D QH118E QH122_1_0 QH122_1_1 QH122_1_2 QH122_1_3 QH122_2_0 QH122_2_1 QH122_2_2 QH122_2_3 QH122_3_0 QH122_3_1 QH122_3_2 QH122_3_3 QH122_4_0 QH122_4_1 QH122_4_2 QH122_4_3 QH122_5_0 QH122_5_1 QH122_5_2 QH122_5_3 QH122A landarea QH123 DOMESTIC HOUSE LAND memsleep /missing meansub /analysis QH102_11 QH102_12 QH102_13 QH102_21 QH102_31 QH102_32 QH102_41 QH102_42 QH102_51 QH102_61 QH102_71 QH102_81 QH102_91 QH102_96 QH107_10 QH107_11 QH107_12 QH107_13 QH107_14 QH107_15 QH107_20 QH107_21 QH107_22 QH107_23 QH107_30 QH107_31 QH107_41 QH107_51 QH107_61 QH107_96 QH107_10_sh QH107_11_sh QH107_12_sh QH107_13_sh QH107_14_sh QH107_15_sh QH107_20_sh QH107_21_sh QH107_22_sh QH107_23_sh QH107_30_sh QH107_31_sh QH107_41_sh QH107_51_sh QH107_96_sh QH110A QH110B QH110C QH110D QH110E QH110F QH110G QH110H QH110I QH110J QH110K QH110L QH110M QH110N QH111_1 QH111_2 QH111_3 QH111_4 QH111_5 QH111_6 QH111_7 QH111_8 QH111_9 QH111_10 QH111_11 QH111_95 QH111_96 QH113 QH114_11 QH114_21 QH114_22 QH114_31 QH114_33 QH114_34 QH114_35 QH114_96 QH115_11 QH115_12 QH115_22 QH115_23 QH115_24 QH115_31 QH115_32 QH115_34 QH115_35 QH115_36 QH115_96 QH116_11 QH116_12 QH116_13 QH116_21 QH116_22 QH116_24 QH116_25 QH116_31 QH116_32 QH116_33 QH116_34 QH116_36 QH116_96 QH118A QH118B QH118C QH118D QH118E QH122_1_0 QH122_1_1 QH122_1_2 QH122_1_3 QH122_2_0 QH122_2_1 QH122_2_2 QH122_2_3 QH122_3_0 QH122_3_1 QH122_3_2 QH122_3_3 QH122_4_0 QH122_4_1 QH122_4_2 QH122_4_3 QH122_5_0 QH122_5_1 QH122_5_2 QH122_5_3 QH122A landarea QH123 DOMESTIC HOUSE LAND memsleep /print univariate initial extraction /criteria factors(1) iterate(25) /extraction pc /rotation norotate /save reg(ALL com) /method=correlation. means com1 by QH102_11 QH102_12 QH102_13 QH102_21 QH102_31 QH102_32 QH102_41 QH102_42 QH102_51 QH102_61 QH102_71 QH102_81 QH102_91 QH102_96 QH107_10 QH107_11 QH107_12 QH107_13 QH107_14 QH107_15 QH107_20 QH107_21 QH107_22 QH107_23 QH107_30 QH107_31 QH107_41 QH107_51 QH107_61 QH107_96 QH107_10_sh QH107_11_sh QH107_12_sh QH107_13_sh QH107_14_sh QH107_15_sh QH107_20_sh QH107_21_sh QH107_22_sh QH107_23_sh QH107_30_sh QH107_31_sh QH107_41_sh QH107_51_sh QH107_96_sh QH110A QH110B QH110C QH110D QH110E QH110F QH110G QH110H QH110I QH110J QH110K QH110L QH110M QH110N QH111_1 QH111_2 QH111_3 QH111_4 QH111_5 QH111_6 QH111_7 QH111_8 QH111_9 QH111_10 QH111_11 QH111_95 QH111_96 QH113 QH114_11 QH114_21 QH114_22 QH114_31 QH114_33 QH114_34 QH114_35 QH114_96 QH115_11 QH115_12 QH115_22 QH115_23 QH115_24 QH115_31 QH115_32 QH115_34 QH115_35 QH115_36 QH115_96 QH116_11 QH116_12 QH116_13 QH116_21 QH116_22 QH116_24 QH116_25 QH116_31 QH116_32 QH116_33 QH116_34 QH116_36 QH116_96 QH118A QH118B QH118C QH118D QH118E QH122_1_0 QH122_1_1 QH122_1_2 QH122_1_3 QH122_2_0 QH122_2_1 QH122_2_2 QH122_2_3 QH122_3_0 QH122_3_1 QH122_3_2 QH122_3_3 QH122_4_0 QH122_4_1 QH122_4_2 QH122_4_3 QH122_5_0 QH122_5_1 QH122_5_2 QH122_5_3 QH122A landarea QH123 DOMESTIC HOUSE LAND memsleep . *** Urban Factor Analysis. filter off. filter by urban. execute. factor /variables QH102_11 QH102_12 QH102_13 QH102_21 QH102_31 QH102_32 QH102_41 QH102_42 QH102_51 QH102_61 QH102_71 QH102_81 QH102_91 QH102_96 QH107_10 QH107_11 QH107_12 QH107_13 QH107_14 QH107_15 QH107_20 QH107_21 QH107_22 QH107_23 QH107_30 QH107_31 QH107_41 QH107_51 QH107_61 QH107_96 QH107_10_sh QH107_11_sh QH107_12_sh QH107_13_sh QH107_14_sh QH107_15_sh QH107_20_sh QH107_21_sh QH107_22_sh QH107_23_sh QH107_30_sh QH107_31_sh QH107_41_sh QH107_51_sh QH107_96_sh QH110A QH110B QH110C QH110D QH110E QH110F QH110G QH110H QH110I QH110J QH110K QH110L QH110M QH110N QH111_1 QH111_2 QH111_3 QH111_4 QH111_5 QH111_6 QH111_7 QH111_8 QH111_9 QH111_10 QH111_11 QH111_95 QH111_96 QH113 QH114_11 QH114_21 QH114_22 QH114_31 QH114_33 QH114_34 QH114_35 QH114_96 QH115_11 QH115_12 QH115_22 QH115_23 QH115_24 QH115_31 QH115_32 QH115_34 QH115_35 QH115_36 QH115_96 QH116_11 QH116_12 QH116_13 QH116_21 QH116_22 QH116_24 QH116_25 QH116_31 QH116_32 QH116_33 QH116_34 QH116_36 QH116_96 QH118A QH118B QH118C QH118D QH118E QH122_1_0 QH122_1_1 QH122_1_2 QH122_1_3 QH122_2_0 QH122_2_1 QH122_2_2 QH122_2_3 QH122_3_0 QH122_3_1 QH122_3_2 QH122_3_3 QH122_4_0 QH122_4_1 QH122_4_2 QH122_4_3 QH122_5_0 QH122_5_1 QH122_5_2 QH122_5_3 QH122A landarea QH123 DOMESTIC HOUSE LAND memsleep /missing meansub /analysis QH102_11 QH102_12 QH102_13 QH102_21 QH102_31 QH102_32 QH102_41 QH102_42 QH102_51 QH102_61 QH102_71 QH102_81 QH102_91 QH102_96 QH107_10 QH107_11 QH107_12 QH107_13 QH107_14 QH107_15 QH107_20 QH107_21 QH107_22 QH107_23 QH107_30 QH107_31 QH107_41 QH107_51 QH107_61 QH107_96 QH107_10_sh QH107_11_sh QH107_12_sh QH107_13_sh QH107_14_sh QH107_15_sh QH107_20_sh QH107_21_sh QH107_22_sh QH107_23_sh QH107_30_sh QH107_31_sh QH107_41_sh QH107_51_sh QH107_96_sh QH110A QH110B QH110C QH110D QH110E QH110F QH110G QH110H QH110I QH110J QH110K QH110L QH110M QH110N QH111_1 QH111_2 QH111_3 QH111_4 QH111_5 QH111_6 QH111_7 QH111_8 QH111_9 QH111_10 QH111_11 QH111_95 QH111_96 QH113 QH114_11 QH114_21 QH114_22 QH114_31 QH114_33 QH114_34 QH114_35 QH114_96 QH115_11 QH115_12 QH115_22 QH115_23 QH115_24 QH115_31 QH115_32 QH115_34 QH115_35 QH115_36 QH115_96 QH116_11 QH116_12 QH116_13 QH116_21 QH116_22 QH116_24 QH116_25 QH116_31 QH116_32 QH116_33 QH116_34 QH116_36 QH116_96 QH118A QH118B QH118C QH118D QH118E QH122_1_0 QH122_1_1 QH122_1_2 QH122_1_3 QH122_2_0 QH122_2_1 QH122_2_2 QH122_2_3 QH122_3_0 QH122_3_1 QH122_3_2 QH122_3_3 QH122_4_0 QH122_4_1 QH122_4_2 QH122_4_3 QH122_5_0 QH122_5_1 QH122_5_2 QH122_5_3 QH122A landarea QH123 DOMESTIC HOUSE LAND memsleep /print univariate initial extraction /criteria factors(1) iterate(25) /extraction pc /rotation norotate /save reg(ALL urb) /method=correlation. means urb1 by QH102_11 QH102_12 QH102_13 QH102_21 QH102_31 QH102_32 QH102_41 QH102_42 QH102_51 QH102_61 QH102_71 QH102_81 QH102_91 QH102_96 QH107_10 QH107_11 QH107_12 QH107_13 QH107_14 QH107_15 QH107_20 QH107_21 QH107_22 QH107_23 QH107_30 QH107_31 QH107_41 QH107_51 QH107_61 QH107_96 QH107_10_sh QH107_11_sh QH107_12_sh QH107_13_sh QH107_14_sh QH107_15_sh QH107_20_sh QH107_21_sh QH107_22_sh QH107_23_sh QH107_30_sh QH107_31_sh QH107_41_sh QH107_51_sh QH107_96_sh QH110A QH110B QH110C QH110D QH110E QH110F QH110G QH110H QH110I QH110J QH110K QH110L QH110M QH110N QH111_1 QH111_2 QH111_3 QH111_4 QH111_5 QH111_6 QH111_7 QH111_8 QH111_9 QH111_10 QH111_11 QH111_95 QH111_96 QH113 QH114_11 QH114_21 QH114_22 QH114_31 QH114_33 QH114_34 QH114_35 QH114_96 QH115_11 QH115_12 QH115_22 QH115_23 QH115_24 QH115_31 QH115_32 QH115_34 QH115_35 QH115_36 QH115_96 QH116_11 QH116_12 QH116_13 QH116_21 QH116_22 QH116_24 QH116_25 QH116_31 QH116_32 QH116_33 QH116_34 QH116_36 QH116_96 QH118A QH118B QH118C QH118D QH118E QH122_1_0 QH122_1_1 QH122_1_2 QH122_1_3 QH122_2_0 QH122_2_1 QH122_2_2 QH122_2_3 QH122_3_0 QH122_3_1 QH122_3_2 QH122_3_3 QH122_4_0 QH122_4_1 QH122_4_2 QH122_4_3 QH122_5_0 QH122_5_1 QH122_5_2 QH122_5_3 QH122A landarea QH123 DOMESTIC HOUSE LAND memsleep . *** Rural Factor Analysis. filter off. filter by rural. execute. factor /variables QH102_11 QH102_12 QH102_13 QH102_21 QH102_31 QH102_32 QH102_41 QH102_42 QH102_51 QH102_61 QH102_71 QH102_81 QH102_91 QH102_96 QH107_10 QH107_11 QH107_12 QH107_13 QH107_14 QH107_15 QH107_20 QH107_21 QH107_22 QH107_23 QH107_30 QH107_31 QH107_41 QH107_51 QH107_61 QH107_96 QH107_10_sh QH107_11_sh QH107_12_sh QH107_13_sh QH107_14_sh QH107_15_sh QH107_20_sh QH107_21_sh QH107_22_sh QH107_23_sh QH107_30_sh QH107_31_sh QH107_41_sh QH107_51_sh QH107_96_sh QH110A QH110B QH110C QH110D QH110E QH110F QH110G QH110H QH110I QH110J QH110K QH110L QH110M QH110N QH111_1 QH111_2 QH111_3 QH111_4 QH111_5 QH111_6 QH111_7 QH111_8 QH111_9 QH111_10 QH111_11 QH111_95 QH111_96 QH113 QH114_11 QH114_21 QH114_22 QH114_31 QH114_33 QH114_34 QH114_35 QH114_96 QH115_11 QH115_12 QH115_22 QH115_23 QH115_24 QH115_31 QH115_32 QH115_34 QH115_35 QH115_36 QH115_96 QH116_11 QH116_12 QH116_13 QH116_21 QH116_22 QH116_24 QH116_25 QH116_31 QH116_32 QH116_33 QH116_34 QH116_36 QH116_96 QH118A QH118B QH118C QH118D QH118E QH122_1_0 QH122_1_1 QH122_1_2 QH122_1_3 QH122_2_0 QH122_2_1 QH122_2_2 QH122_2_3 QH122_3_0 QH122_3_1 QH122_3_2 QH122_3_3 QH122_4_0 QH122_4_1 QH122_4_2 QH122_4_3 QH122_5_0 QH122_5_1 QH122_5_2 QH122_5_3 QH122A landarea QH123 DOMESTIC HOUSE LAND memsleep /missing meansub /analysis QH102_11 QH102_12 QH102_13 QH102_21 QH102_31 QH102_32 QH102_41 QH102_42 QH102_51 QH102_61 QH102_71 QH102_81 QH102_91 QH102_96 QH107_10 QH107_11 QH107_12 QH107_13 QH107_14 QH107_15 QH107_20 QH107_21 QH107_22 QH107_23 QH107_30 QH107_31 QH107_41 QH107_51 QH107_61 QH107_96 QH107_10_sh QH107_11_sh QH107_12_sh QH107_13_sh QH107_14_sh QH107_15_sh QH107_20_sh QH107_21_sh QH107_22_sh QH107_23_sh QH107_30_sh QH107_31_sh QH107_41_sh QH107_51_sh QH107_96_sh QH110A QH110B QH110C QH110D QH110E QH110F QH110G QH110H QH110I QH110J QH110K QH110L QH110M QH110N QH111_1 QH111_2 QH111_3 QH111_4 QH111_5 QH111_6 QH111_7 QH111_8 QH111_9 QH111_10 QH111_11 QH111_95 QH111_96 QH113 QH114_11 QH114_21 QH114_22 QH114_31 QH114_33 QH114_34 QH114_35 QH114_96 QH115_11 QH115_12 QH115_22 QH115_23 QH115_24 QH115_31 QH115_32 QH115_34 QH115_35 QH115_36 QH115_96 QH116_11 QH116_12 QH116_13 QH116_21 QH116_22 QH116_24 QH116_25 QH116_31 QH116_32 QH116_33 QH116_34 QH116_36 QH116_96 QH118A QH118B QH118C QH118D QH118E QH122_1_0 QH122_1_1 QH122_1_2 QH122_1_3 QH122_2_0 QH122_2_1 QH122_2_2 QH122_2_3 QH122_3_0 QH122_3_1 QH122_3_2 QH122_3_3 QH122_4_0 QH122_4_1 QH122_4_2 QH122_4_3 QH122_5_0 QH122_5_1 QH122_5_2 QH122_5_3 QH122A landarea QH123 DOMESTIC HOUSE LAND memsleep /print univariate initial extraction /criteria factors(1) iterate(25) /extraction pc /rotation norotate /save reg(ALL rur) /method=correlation. means rur1 by QH102_11 QH102_12 QH102_13 QH102_21 QH102_31 QH102_32 QH102_41 QH102_42 QH102_51 QH102_61 QH102_71 QH102_81 QH102_91 QH102_96 QH107_10 QH107_11 QH107_12 QH107_13 QH107_14 QH107_15 QH107_20 QH107_21 QH107_22 QH107_23 QH107_30 QH107_31 QH107_41 QH107_51 QH107_61 QH107_96 QH107_10_sh QH107_11_sh QH107_12_sh QH107_13_sh QH107_14_sh QH107_15_sh QH107_20_sh QH107_21_sh QH107_22_sh QH107_23_sh QH107_30_sh QH107_31_sh QH107_41_sh QH107_51_sh QH107_96_sh QH110A QH110B QH110C QH110D QH110E QH110F QH110G QH110H QH110I QH110J QH110K QH110L QH110M QH110N QH111_1 QH111_2 QH111_3 QH111_4 QH111_5 QH111_6 QH111_7 QH111_8 QH111_9 QH111_10 QH111_11 QH111_95 QH111_96 QH113 QH114_11 QH114_21 QH114_22 QH114_31 QH114_33 QH114_34 QH114_35 QH114_96 QH115_11 QH115_12 QH115_22 QH115_23 QH115_24 QH115_31 QH115_32 QH115_34 QH115_35 QH115_36 QH115_96 QH116_11 QH116_12 QH116_13 QH116_21 QH116_22 QH116_24 QH116_25 QH116_31 QH116_32 QH116_33 QH116_34 QH116_36 QH116_96 QH118A QH118B QH118C QH118D QH118E QH122_1_0 QH122_1_1 QH122_1_2 QH122_1_3 QH122_2_0 QH122_2_1 QH122_2_2 QH122_2_3 QH122_3_0 QH122_3_1 QH122_3_2 QH122_3_3 QH122_4_0 QH122_4_1 QH122_4_2 QH122_4_3 QH122_5_0 QH122_5_1 QH122_5_2 QH122_5_3 QH122A landarea QH123 DOMESTIC HOUSE LAND memsleep . * label the created score variables. rename variables (com1 urb1 rur1=comscore urbscore rurscore). variable labels comscore 'Common wealth score' /urbscore 'Urban wealth score' /rurscore 'Rural wealth score'. * Add a variable used for linking later. filter off. string rowtype_ (A8). compute rowtype_ = 'EST'. * Calculate regressions. ** Area=urban. filter off. filter by urban. execute. * Declare a dataset to be written to in the regression. dataset declare urbancorv. * Run regression of comscore with urbscore. regression /missing listwise /statistics coeff outs R anova /criteria=pin(.05) pout(.10) /noorigin /dependent comscore /method=enter urbscore /outfile=corv(urbancorv). * Activate file of output from regression. dataset activate urbancorv. * Drop all rows of output except the coefficients. select if (rowtype_ = 'EST'). execute. * Delete unnecessary variables before merging. delete variables DEPVAR_ VARNAME_. * Rename variables containing the constant and the coefficient. rename variables CONST_=urbconst urbscore=urbcoeff. * Re-activate the main household data. dataset activate assets. * merge the coefficients. match files /file = * /table = urbancorv /by ROWTYPE_. execute. * Calculate regressions. ** Area=rural. filter off. filter by rural. execute. * Declare a dataset to be written to in the regression. dataset declare ruralcorv. * Run regression of comscore with rurscore. regression /missing listwise /statistics coeff outs R anova /criteria=pin(.05) pout(.10) /noorigin /dependent comscore /method=enter rurscore /outfile=corv(ruralcorv). * Activate file of output from regression. dataset activate ruralcorv. * Drop all rows of output except the coefficients. select if (rowtype_ = 'EST'). execute. * Delete unnecessary variables before merging. delete variables DEPVAR_ VARNAME_. * Rename variables containing the constant and the coefficient. rename variables CONST_=rurconst rurscore=rurcoeff. * Re-activate the main household data. dataset activate assets. * merge the coefficients. match files /file = * /table = ruralcorv /by ROWTYPE_. execute. dataset close urbancorv. dataset close ruralcorv. dataset activate assets. filter off. *** Calculate combined wealth score from Urban and Rural Scores. * Use coefficients from urban and rural regressions above. compute combscor=0. print formats combscor (f11.5). write formats combscor (f11.5). ** Urban. if (urban = 1) combscor=urbconst+urbcoeff*urbscore. ** Rural. if (rural = 1) combscor=rurconst+rurcoeff*rurscore. variable labels combscor 'Combined national wealth score'. execute. compute hhwt = QHWEIGHT/1000000. variable labels hhwt 'HH weights'. weight by hhwt. filter off. execute. frequencies variables=combscor comscore /format=notable /ntiles=5 /statistics=stddev mean /histogram normal /order=analysis. filter off. filter by urban. execute. frequencies variables=combscor urbscore /format=notable /ntiles=5 /statistics=stddev mean /histogram normal /order=analysis. filter off. filter by rural. execute. frequencies variables=combscor rurscore /format=notable /ntiles=5 /statistics=stddev mean /histogram normal /order=analysis. filter off. execute. *Calculate quintiles and scores for data file. compute hhmemwt=QHWEIGHT*hhusual/1000000. weight by hhmemwt. variable labels hhmemwt 'HH members weighting for index'. filter off. filter by urban. execute. rank variables=urbscore (A) /rank /ntiles (5) /print=yes /ties=mean. filter off. filter by rural. execute. rank variables=rurscore (A) /rank /ntiles (5) /print=yes /ties=mean. filter off. execute. rank variables=combscor (A) /rank /ntiles (5) /print=yes /ties=mean. *** Check on quintiles. frequencies variables=ncombsco. weight by hhwt. means tables= QH102_11 QH102_12 QH102_13 QH102_21 QH102_31 QH102_32 QH102_41 QH102_42 QH102_51 QH102_61 QH102_71 QH102_81 QH102_91 QH102_96 QH107_10 QH107_11 QH107_12 QH107_13 QH107_14 QH107_15 QH107_20 QH107_21 QH107_22 QH107_23 QH107_30 QH107_31 QH107_41 QH107_51 QH107_61 QH107_96 QH107_10_sh QH107_11_sh QH107_12_sh QH107_13_sh QH107_14_sh QH107_15_sh QH107_20_sh QH107_21_sh QH107_22_sh QH107_23_sh QH107_30_sh QH107_31_sh QH107_41_sh QH107_51_sh QH107_96_sh QH110A QH110B QH110C QH110D QH110E QH110F QH110G QH110H QH110I QH110J QH110K QH110L QH110M QH110N QH111_1 QH111_2 QH111_3 QH111_4 QH111_5 QH111_6 QH111_7 QH111_8 QH111_9 QH111_10 QH111_11 QH111_95 QH111_96 QH113 QH114_11 QH114_21 QH114_22 QH114_31 QH114_33 QH114_34 QH114_35 QH114_96 QH115_11 QH115_12 QH115_22 QH115_23 QH115_24 QH115_31 QH115_32 QH115_34 QH115_35 QH115_36 QH115_96 QH116_11 QH116_12 QH116_13 QH116_21 QH116_22 QH116_24 QH116_25 QH116_31 QH116_32 QH116_33 QH116_34 QH116_36 QH116_96 QH118A QH118B QH118C QH118D QH118E QH122_1_0 QH122_1_1 QH122_1_2 QH122_1_3 QH122_2_0 QH122_2_1 QH122_2_2 QH122_2_3 QH122_3_0 QH122_3_1 QH122_3_2 QH122_3_3 QH122_4_0 QH122_4_1 QH122_4_2 QH122_4_3 QH122_5_0 QH122_5_1 QH122_5_2 QH122_5_3 QH122A landarea QH123 DOMESTIC HOUSE LAND memsleep by ncombsco nurbscor nrurscor /cells mean count stddev. graph /histogram(normal)=combscor /title= 'Distribution of Households by Wealth Scores'. frequencies variables=combscor /format=notable /ntiles=5 /statistics=stddev minimum maximum semean mean median mode skewness seskew kurtosis sekurt /order=analysis. weight off. filter off. write formats combscor urbscore rurscore (f11.5). * Save final dataset of assets. save outfile='assets.sav'. *** Write out scores file. write outfile='scores.dat' table /QHCLUST QHNUMBER combscor ncombsco urbscore nurbscor rurscore nrurscor. execute.